package com.liuwei.spring.cloud.biz.support;

import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.Resource;
import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : evan.liu
 * @version V1.0
 * @Description: 全局默认配置
 * @date Date : 2022年03月12日 2:01 下午
 */
@SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
@Data
@Configuration
public class ApolloValues implements InitializingBean {

    @Value("${spring.profiles.active:'dev'}")
    private String spring_profiles_active;

    @Value("${system.exception.warning.webhook:https://open.feishu.cn/open-apis/bot/v2/hook/62b298be-fba2-47a3-9eb1-b0b943542178}")
    private String system_exception_warning_webhook;

    @Value("${system.exception.warning.black.class:}")
    private String system_exception_warning_ignore_class;

    @Value("${system.exception.warning.black.words:}")
    private String system_exception_warning_ignore_words;

    @Value("${system.exception.warning.expression:}")
    private String system_exception_warning_expression;

    @Resource
    ApplicationEventPublisher publisher;

    @Resource
    ObjectMapper objectMapper;

    @Override
    public void afterPropertiesSet() throws Exception {
    }
}
